package com.lysj.print.print.domain;

import com.lysj.admin.utils.spring.foundation.base.BaseEntity;
import com.lysj.admin.utils.validation.annotation.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author Created by drj on 2019-03-15 16:40:54
 * @description 打印机实体
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "lysj_printer_printer")
public class Printer extends BaseEntity {

    @Getter
    public enum PrintType {
        FEIE(1, "飞鹅打印机"),
        WANGKOU(2, "网口/WIFI打印机"),
        USB(3, "USB打印机"),
        LINGJU(4, "零距打印机");
        private Integer code;

        private String status;

        PrintType(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    @Getter
    public enum IsDefault {
        DEFAULT(1, "默认"),
        NORMAL(2, "正常");
        private Integer code;

        private String status;

        IsDefault(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    @Getter
    public enum PrintWide {
        EIGHTY(1, "80mm"),
        FIFTYEIGHTY(2, "58mm");
        private Integer code;

        private String status;

        PrintWide(Integer code, String status) {
            this.code = code;
            this.status = status;
        }
    }

    @NotBlank(message = "打印机名称不能为空")
    private String name; //打印机名称
    private String storeId; //门店id
    @NotBlank(message = "请选择打印机类型")
    private Integer printType;//打印机类型
    @NotBlank(message = "打印机SN码不能为空")
    private String printSnCode;//IP地址/主机名/SN码
    @NotBlank(message = "打印机Key不能为空")
    private String printKey;//端口号/设备名/打印机KEY
    @NotBlank(message = "请选择打印机宽度")
    private Integer printWide;//打印纸宽度
    private Integer waiting;//待打印
    private Integer isDefault;//区分是否为默认打印机
}